package src

import (
	"encoding/json"
	"os"

	"github.com/sirupsen/logrus"
)

var botsKey = make(map[string]string)

const (
	URL         = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
	OKMsg       = "告警恢复"
	AlertingMsg = "触发告警"
	OK          = "OK"
	Alerting    = "Alerting"
	ColorGreen  = "info"
	ColorGray   = "comment"
	ColorRed    = "warning"
)

func initEnv() {
	bots := os.Getenv("bots")
	if bots == "" {
		logrus.Fatal("bot envirionment is not exists!")
	}
	err := json.Unmarshal([]byte(bots), &botsKey)
	if err != nil {
		logrus.Fatal("json error: ", err.Error())
	}
}
